<?php
echo "<div align=\"center\">";
if ($_REQUEST["uloz_nick"]) {
    $ip = $_POST['ip'];
    $nick = $_POST['nick'];
    $sql = MySQL_Query("UPDATE ip_cenik SET nick='$nick' WHERE ip='$ip'");
}
$vysledek = mysql_query("select * from ip_cenik");
while ($zaznam = MySQL_Fetch_Array($vysledek)) {
    $kolikrat = $kolikrat + $zaznam['pocet'];
}
?>
<table border="1" width="700">
    <td>Spuštěno 15.1.2010 17:31</td>
    <td><?php echo $kolikrat; ?>x použito</td>
    <td>Nick</td>
    <td>Uložit</td>
    <?php
    $vysledek = mysql_query("select * from ip_cenik order by pocet desc");
    while ($zaznam = MySQL_Fetch_Array($vysledek)) {
    ?>
        <tr>
        <form action="?co=administrace&vyber=3" name="form1" method="post">
            <td><?php echo $zaznam['ip'] ?><input type="hidden" value="<?php echo $zaznam['ip'] ?>" name="ip"></td>
            <td><?php echo $zaznam['pocet'] ?>x použito</td>
            <td><input type="text" name="nick" value="<?php echo $zaznam['nick'] ?>"></td>
                <td><input type="submit" value="Ulož nick" name="uloz_nick"></form></td>
<?php
    } // WHILE
    echo "</div>";
?>